class stack
{
public:
   stack(int num) 
   {  
	   top = 0; 
	   maxelem = num; 
	   s = new int[maxelem]; 
   }

   void push(int t)
   {
      if (top == maxelem) 
		  return;

      s[top++] = t;
   }

   int pop()
   {
      if (top == 0) 
		  return -1;

      return s[--top];
   }

   int   empty()  
   {  
	   return top == 0;  
   }

   friend void print(const stack& obj);

private:
   int *s;
   int top;
   int maxelem;
};